package cn.school.course.service.impl;

import cn.hutool.core.date.DateUtil;
import cn.school.common.utils.CourseUtils;
import cn.school.common.utils.WeekDayVo;
import cn.school.course.entity.CoursePlanConflict;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @className: Test
 * @author: fangjin.tao
 * @date: 2023/1/6
 **/
public class Test {
	public static void main(String[] args) {
		// testListObjTransLongList();
		// testCourseUtilsWeekDay();
		System.out.println(DateUtil.beginOfDay(Calendar.getInstance().getTime()));
		System.out.println(DateUtil.endOfDay(Calendar.getInstance().getTime()));
	}
	
	public static void testCourseUtilsWeekDay() {
		WeekDayVo weekDayVo = CourseUtils.gennerWeedDayDate(new Date(), 1, 5);
		WeekDayVo weekDayVo21 = CourseUtils.gennerWeedDayDate(new Date(), 2, 1);
		WeekDayVo weekDayVo22 = CourseUtils.gennerWeedDayDate(new Date(), 2, 2);
		WeekDayVo weekDayVo23 = CourseUtils.gennerWeedDayDate(new Date(), 2, 3);
		WeekDayVo weekDayVo24 = CourseUtils.gennerWeedDayDate(new Date(), 2, 4);
		WeekDayVo weekDayVo25 = CourseUtils.gennerWeedDayDate(new Date(), 2, 5);
		WeekDayVo weekDayVo26 = CourseUtils.gennerWeedDayDate(new Date(), 2, 6);
		WeekDayVo weekDayVo27 = CourseUtils.gennerWeedDayDate(new Date(), 2, 7);
		
		WeekDayVo weekDayVo31 = CourseUtils.gennerWeedDayDate(new Date(), 3, 1);
		WeekDayVo weekDayVo32 = CourseUtils.gennerWeedDayDate(new Date(), 3, 2);
		WeekDayVo weekDayVo33 = CourseUtils.gennerWeedDayDate(new Date(), 3, 3);
		WeekDayVo weekDayVo34 = CourseUtils.gennerWeedDayDate(new Date(), 3, 4);
		WeekDayVo weekDayVo35 = CourseUtils.gennerWeedDayDate(new Date(), 3, 5);
		WeekDayVo weekDayVo36 = CourseUtils.gennerWeedDayDate(new Date(), 3, 6);
		WeekDayVo weekDayVo37 = CourseUtils.gennerWeedDayDate(new Date(), 3, 7);
		
		WeekDayVo weekDayVo14 = CourseUtils.gennerWeedDayDate(new Date(), 1, 4);
		System.out.println(weekDayVo14);
	}
	
	/**
	 * 测试LISt<Object> 转换List<Long>
	 * @author fangjin.tao
	 * @updateTime 2023/1/6 17:25
	 * @throws
	 */
	public static void testListObjTransLongList() {
		List<CoursePlanConflict> list = new ArrayList<>();
		CoursePlanConflict c1 = new CoursePlanConflict();
		c1.setId(1L);
		CoursePlanConflict c2 = new CoursePlanConflict();
		c2.setId(2l);
		list.add(c1);
		list.add(c2);
		System.out.println(list.stream().map(CoursePlanConflict::getId).collect(Collectors.toList()));
	}
	
	
}
